import request from '@/config/axios'

// 学员预约记录 VO
export interface ScheduleBookingVO {
  userId: number // 学员ID
  coachId: number // 教练ID
  bookingDate: Date // 预约日期
  startTime: localtime // 预约开始时间
  endTime: localtime // 预约结束时间
}

// 学员预约记录 API
export const ScheduleBookingApi = {
  // 查询学员预约记录分页
  getScheduleBookingPage: async (params: any) => {
    return await request.get({ url: `/system/schedule-booking/page`, params })
  },

  // 查询学员预约记录详情
  getScheduleBooking: async (id: number) => {
    return await request.get({ url: `/system/schedule-booking/get?id=` + id })
  },

  // 新增学员预约记录
  createScheduleBooking: async (data: ScheduleBookingVO) => {
    return await request.post({ url: `/system/schedule-booking/create`, data })
  },

  // 修改学员预约记录
  updateScheduleBooking: async (data: ScheduleBookingVO) => {
    return await request.put({ url: `/system/schedule-booking/update`, data })
  },

  // 删除学员预约记录
  deleteScheduleBooking: async (id: number) => {
    return await request.delete({ url: `/system/schedule-booking/delete?id=` + id })
  },

  // 导出学员预约记录 Excel
  exportScheduleBooking: async (params) => {
    return await request.download({ url: `/system/schedule-booking/export-excel`, params })
  },
}